package com.rul.mars.order.controller;

import com.rul.mars.common.api.CommonResult;
import com.rul.mars.mbg.domain.CommentDetail;
import com.rul.mars.mbg.domain.CommentReplayParam;
import com.rul.mars.order.service.CommentReplayService;
import com.rul.mars.order.service.CommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 评论回复服务接口
 *
 * @author RuL
 */
@Api(tags = "CommentReplayController", description = "评论回复接口")
@RestController
@RequestMapping("/comment")
public class CommentReplayController {

    @Autowired
    private CommentReplayService commentReplayService;

    /**
     * 回复评论
     *
     * @param param 回复参数
     * @return 回复结果
     */
    @ApiOperation("回复评论")
    @PostMapping("/replay")
    public CommonResult replay(@RequestBody CommentReplayParam param) {
        boolean success = commentReplayService.replay(param);
        if (success) {
            return CommonResult.success();
        }
        return CommonResult.failed();
    }
}
